package ru.usu.gv.utils.generators;

import ru.usu.gv.core.I18nService;
import ru.usu.gv.graph.Graph;
import ru.usu.gv.gui.component.GVIntegerField;
import ru.usu.gv.utils.RandomUtilities;

import javax.swing.JPanel;

/**
 @author Sergey Pupyrev 
 14.05.2007
 */

public class BinaryTreeGenerator extends GraphGeneratorBase
{
	private GVIntegerField count;

	public String getTitle()
	{
		return I18nService.get("generator.binary_tree");
	}

	public Graph generate(JPanel panel)
	{
		return RandomUtilities.generateBinaryTree(count.getValue());
	}

	@Override
	public void customizePanel(JPanel panel)
	{
		super.customizePanel(panel);

		count = new GVIntegerField(I18nService.get("generator.binary_tree.height"), 8, true);

		panel.add(count);
	}

}
